package com.iss;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Scanner;

public class TestStatement {
	public static void main(String[] args) throws ClassNotFoundException, SQLException {
		Scanner sc = new Scanner(System.in);
		System.out.println("请输入用户名:");
		String uname = sc.next();
		System.out.println("请输入密码:");
		String pw = sc.next();
		Connection con = ConnectionUtil.getConnection();
		Statement sta = StatementUtil.getStatement(con);
		String sql = "select * from login where username='"+uname+"'and password='"+pw+"'"; 
		ResultSet rs = ResultsetUtil.getResult(sta, sql);
		if(rs.next()){
			System.out.println(rs.getString(2)+rs.getString(3));
		}else{
			System.out.println("-----");
		}
	}
}
